import { defineStore } from 'pinia';

const useCounterStore = defineStore('counter', {
  state: () => {
    return {
      count: 16000,
    };
  },
  getters: {
    double(): number {
      return this.count * 2;
    },
  },
  actions: {
    add() {
      this.count++;
    },
    asyncadd() {
      setTimeout(() => {
        this.count++;
      }, 1000);
    },
  },
});

export default useCounterStore;
